package com.ijunfu.study.jdk.jdk8.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 * @Title : java.util.Date 线程非安全示例
 * @Remarks:
 * @Author : Weizhiguo
 * @Version: 1.0.0
 * @Date : 2022-04-30
 */
public class DateThreadDemo {

    public static void main(String[] args) throws ParseException {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

        for(int i=0; i<50; i++) {
            new Thread(() -> {
                try {
                    System.out.println(dateFormat.parse("2022-04-30"));
                } catch (ParseException e) {
                    throw new RuntimeException(e);
                }
            }).start();
        }
    }
}
